home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Toolbars and Status Bars / StatusBarAndAutoScroll / StatusBarAndAutoScroll.cs next >
Encoding:
Text File  |  2001-01-15  |  1.1 KB  |  39 lines

  1. //-----------------------------------------------------
  2. // StatusBarAndAutoScroll.cs ⌐ 2001 by Charles Petzold
  3. //-----------------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class StatusBarAndAutoScroll: Form
  9. {
  10.      public static void Main()
  11.      {
  12.           Application.Run(new StatusBarAndAutoScroll());
  13.      }
  14.      public StatusBarAndAutoScroll()
  15.      {
  16.           Text = "Status Bar and Auto-Scroll";
  17.           AutoScroll = true;
  18.  
  19.                // Create status bar.
  20.  
  21.           StatusBar sb = new StatusBar();
  22.           sb.Parent = this;
  23.           sb.Text = "My initial status bar text";
  24.  
  25.                // Create labels as children of the form.
  26.  
  27.           Label label = new Label();
  28.           label.Parent = this;
  29.           label.Text = "Upper left";
  30.           label.Location = new Point(0, 0);
  31.  
  32.           label = new Label();
  33.           label.Parent = this;
  34.           label.Text = "Lower right";
  35.           label.Location = new Point(250, 250);
  36.           label.AutoSize = true;
  37.      }
  38. }
  39.